package io.renren.modules.lucky.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.renren.common.utils.PageUtils;
import io.renren.modules.lucky.entity.AppWxUserEntity;
import io.renren.modules.lucky.entity.WeiXinOpenIdInfoEntiy;
import io.renren.modules.lucky.entity.WeiXinUserInfoEntiy;

import java.io.IOException;
import java.util.Map;

/**
 * 微信登录
 */
public interface AppWxUserService extends IService<AppWxUserEntity> {

    String getWxJsSign(String url, String timestamp, String nonce_str);

    WeiXinOpenIdInfoEntiy getOpenIdInfo(String code, String appId, String appSecret, Integer wxType);

    String getWxAccessToken() throws IOException;

    String getWxJSAPI() throws IOException;

    WeiXinUserInfoEntiy getWeixinUserInfo(String openId, String accessToken,String latitude,String longitude);

    /**
     * 电话是否绑定了微信 TODO
     *
     * @param phoneNum
     * @return
     * @author HObOCat
     * @date 2019/11/8 9:26
     */
    Boolean IsBindWechat(String phoneNum);

    /**
     * 手机与微信进行绑定 TODO
     *
     * @param phoneNum,openId
     * @return
     * @author HObOCat
     * @date 2019/11/8 10:40
     */
    Boolean bindWechatWithPhone(String phoneNum, String openId);

    PageUtils queryPage(Map<String, Object> params);

}

